<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <title>分配角色</title>
    <th:block th:replace="/backstage/common_resources::common_css"></th:block>
    <th:block th:replace="/backstage/common_resources::common_js"></th:block>

</head>

<body class="hold-transition skin-purple sidebar-mini">
<header th:replace="/backstage/common_header::header"></header>
<aside th:replace="/backstage/common_aside::aside"></aside>

<div class="wrapper">

    <div class="content-wrapper">

        <div class="content-wrapper" style="margin-left: 2px;">

            <!-- 内容头部 -->
            <section class="content-header">
                <h1>
                    用户管理
                    <small>分配角色</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="@{/backstage/index}"><i class="fa fa-dashboard"></i> 首页</a></li>
                    <li><a href="@{/backstage/admin_all}">用户管理</a></li>
                    <li class="active">分配角色</li>
                </ol>
            </section>
            <!-- 内容头部 /-->

            <!-- 正文区域 -->
            <section class="content">

                <!-- .box-body -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">列表</h3>
                    </div>

                    <div class="box-body">

                        <!-- 数据表格 -->
                        <div class="table-box">
                            <form th:action="@{/backstage/admin/updateRole}">
                                <input type="hidden" name="aid" th:value="${aid}">
                                <!--数据列表-->
                                <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                                    <thead>
                                    <tr>
                                        <th class="" style="padding-right:0px;">
                                            <input id="selall" type="checkbox" class="icheckbox_square-blue">
                                        </th>
                                        <th>角色名</th>
                                        <th>角色描述</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr th:each="role:${roles}">
                                        <td th:if="${role.adminHas}">
                                            <input name="ids" type="checkbox" th:value="${role.rid}"
                                                   class="icheckbox_square-blue" checked>
                                        </td>
                                        <td th:if="${!role.adminHas}">
                                            <input name="ids" type="checkbox" th:value="${role.rid}"
                                                   class="icheckbox_square-blue">
                                        </td>
                                        <td th:text="${role.roleName}"></td>
                                        <td th:text="${role.roleDesc}"></td>
                                    </tr>
                                    </tbody>
                                </table>
                                <div class="box-title text-center">
                                    <button type="submit" class="btn bg-maroon">保存</button>
                                    <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
                                </div>
                            </form>
                            <!--数据列表/-->

                        </div>
                        <!-- 数据表格 /-->

                    </div>
                    <!-- /.box-body -->

                </div>

            </section>
            <!-- 正文区域 /-->

        </div>

    </div>

</div>
<footer th:replace="/backstage/common_footer::footer"></footer>

</body>

</html>